﻿@model MasResourceType

@if (ViewContext.RouteData.Values["action"].ToString().ToLower() == "edit")
{
    @Html.HiddenFor(model => model.ResTypeId)
}
@Html.HiddenFor(model => model.RecordStatus)
@Html.HiddenFor(model => model.CreatedBy)
@Html.HiddenFor(model => model.CreatedWhen)
@Html.HiddenFor(model => model.UpdatedBy)
@Html.HiddenFor(model => model.UpdatedWhen)

@{
    string depCal = CompareUtility.IsStringsEqual(Model.DepreciationCalculate, "Y") ? "Y" : "N";
}

<div class="widget-box">
	<div class="widget-header header-color-blue2">
        <h4 class="lighter smaller">ข้อมูลหลัก</h4>
    </div>
	<div class="widget-body">
		<div class="widget-body-inner">
			<div class="widget-main">
				<div class="control-group">
					<div class="control-label">
						@Html.DisplayNameFor(model => model.Code)
					</div>
					<div class="controls">
						@Html.EditorFor(model => model.Code)
						@Html.ValidationMessageFor(model => model.Code)
					</div>            
				</div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.Name)
                    </div>
                    <div class="controls">
                        @Html.EditorFor(model => model.Name)
                        @Html.ValidationMessageFor(model => model.Name)
                    </div>            
                </div>
                
                <div class="control-group">
                    <div class="control-label">
                        นำไปคิดค่าเสื่อม
                    </div>
                    <div class="controls">
                        <table>
                            <tr>
                                <td>
                                    <label>
                                        <input name="DepreciationCalculate" type="radio" value="Y" @(depCal == "Y" ? "checked=checked":string.Empty)>
                                        <span class="lbl"> ใช่</span>
                                    </label>
                                </td>
                                <td>
                                    <label>&nbsp;&nbsp;&nbsp;
                                        <input name="DepreciationCalculate" type="radio" value="N" @(depCal != "Y" ? "checked=checked":string.Empty)>
                                        <span class="lbl"> ไม่ใช่</span>
                                    </label>
                                </td>
                            </tr>
                        </table>
                    </div>            
                </div>

                <div class="control-group">
					<div class="control-label">
						@Html.DisplayNameFor(model => model.Descr)
					</div>
					<div class="controls">
						@Html.EditorFor(model => model.Descr, "TextArea")
						@Html.ValidationMessageFor(model => model.Descr)
					</div>
				</div>
			</div>
		</div>
	</div> 
</div>
